using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SMWJamecl.BusinessEntities;

namespace SMWJamecl.Repository.Mapping
{
    public class FuncioneMap : EntityTypeConfiguration<Funcione>
    {
        public FuncioneMap()
        {
            // Primary Key
            this.HasKey(t => t.Id_Funcion);

            // Properties
            this.Property(t => t.Id_Funcion)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Desc_Funcion)
                .HasMaxLength(50);

            this.Property(t => t.NroBrevete)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Funciones");
            this.Property(t => t.Id_Funcion).HasColumnName("Id_Funcion");
            this.Property(t => t.Desc_Funcion).HasColumnName("Desc_Funcion");
            this.Property(t => t.NroBrevete).HasColumnName("NroBrevete");
        }
    }
}
